;-------------------------------------------------------------LICENSE--------------------------------------------------------------;
;                                                                                                                                  ;
;The MAP code is written in Fortran language for magnetohydrodynamics (MHD) calculation with the adaptive mesh refinement (AMR)    ;
;and Message Passing Interface (MPI) parallelization.                                                                              ;
;                                                                                                                                  ;
;Copyright (C) 2012                                                                                                                ;
;Ronglin Jiang                                                                                                                     ;
;rljiang@ssc.net.cn                                                                                                                ;
;585 Guoshoujing Road. Pudong, Shanghai, P.R.C. 201203                                                                             ;
;                                                                                                                                  ;
;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License         ;
;as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.             ;
;                                                                                                                                  ;
;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of    ;
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.                        ;
;                                                                                                                                  ;
;You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software     ;
;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.                                                   ;
;                                                                                                                                  ;
;-------------------------------------------------------------LICENSE--------------------------------------------------------------;

pro usr_var,xsize, ysize

on_error, 2

if strlowcase(!d.name) eq 'x' then begin
  ex = 0
  defsysv, '!usr_scale', exists = ex
  if ex eq 0 then defsysv, '!usr_scale', 1
endif
if strlowcase(!d.name) eq 'win' then begin
  ex = 0
  defsysv, '!usr_scale', exists = ex
  if ex eq 0 then defsysv, '!usr_scale', 1
endif
if strlowcase(!d.name) eq 'ps' then begin
  ex = 0
  defsysv, '!usr_scale', exists = ex
  if ex eq 0 then defsysv, '!usr_scale', 28.35
endif

ex = 0
defsysv, '!usr_win_size', exists = ex
if ex eq 0 then defsysv, '!usr_win_size', min([xsize, ysize])
ex = 0
defsysv, '!usr_chars', exists = ex
if ex eq 0 then defsysv, '!usr_chars', 0.0048 * !usr_win_size
ex = 0
defsysv, '!usr_chars_bar', exists = ex
if ex eq 0 then defsysv, '!usr_chars_bar', 0.0042 * !usr_win_size
ex = 0
defsysv, '!usr_chart', exists = ex
if ex eq 0 then defsysv, '!usr_chart', 0.003 * !usr_win_size
ex = 0
defsysv, '!usr_syms', exists = ex
if ex eq 0 then defsysv, '!usr_syms', 0.003 * !usr_win_size
ex = 0
defsysv, '!usr_thick', exists = ex
if ex eq 0 then defsysv, '!usr_thick', 0.0045 * !usr_win_size
ex = 0
defsysv, '!usr_xthick', exists = ex
if ex eq 0 then defsysv, '!usr_xthick', 0.003 * !usr_win_size
ex = 0
defsysv, '!usr_ythick', exists = ex
if ex eq 0 then defsysv, '!usr_ythick', 0.003 * !usr_win_size
ex = 0
defsysv, '!usr_othick', exists = ex
if ex eq 0 then defsysv, '!usr_othick', 0.003 * !usr_win_size
ex = 0
defsysv, '!usr_space', exists = ex
if ex eq 0 then defsysv, '!usr_space', 1
ex = 0
defsysv, '!usr_pspace', exists = ex
if ex eq 0 then defsysv, '!usr_pspace', 3
ex = 0
defsysv, '!usr_x_px_cm', exists = ex
if ex eq 0 then defsysv, '!usr_x_px_cm', !d.x_px_cm
ex = 0
defsysv, '!usr_y_px_cm', exists = ex
if ex eq 0 then defsysv, '!usr_y_px_cm', !d.y_px_cm

entry_plot = !d.name
if strlowcase(!version.os_family) eq 'unix' then set_plot, 'x'
if strlowcase(!version.os_family) eq 'window' then set_plot, 'win'
if strlowcase(!version.os_family) eq 'macos' then set_plot, 'mac'

a = findgen(17) * (!pi * 2 / 16.)
usersym, cos(a), sin(a), /fill

set_plot, entry_plot

end
